﻿using UnityEngine;
using System.Collections;

public class SheepSpawner : MonoBehaviour {
    public float timer;

	// Use this for initialization
	void Start () {
        timer = Time.time;
	}
	
	// Update is called once per frame
	void Update () {
        if (Time.time - timer > GameManager.spawnRate)
        {
            Vector3 position = new Vector3(Random.Range(-60, 60), 120, 0);
            Instantiate(Resources.Load("Sheep"), position, Quaternion.identity);
            timer = Time.time;
        }

	}
}
